package com.chb.controller;

import com.chb.service.OrderService;
import com.chb.vo.Result;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: 陈海彬
 * @date: Created in 2023/12/2 19:18
 * @description: 订单控制层
 * @modified By:
 * @version: 1.0
 */
@RestController
@RequestMapping("order")
public class OrderController {

    @Resource
    private OrderService orderService;

    /**
     * @param orderNo 订单编号
     * @return com.chb.vo.Result
     * @create by: 陈海彬
     * @description: 生成订单二维码
     * @create time: 2023/12/2 21:17
     */
    @PostMapping("createNavite/{orderNo}")
    public Result createNavite(@PathVariable String orderNo) {
        return orderService.createNavite(orderNo);
    }


    /**
     * @param orderNo 订单编号
     * @return com.chb.vo.Result
     * @create by: 陈海彬
     * @description: 查询订单是否支付成功
     * @create time: 2023/12/2 21:16
     */
    @PostMapping("queryPayStatus/{orderNo}")
    public Result queryPayStatus(@PathVariable String orderNo) {
        return orderService.queryPayStatus(orderNo);
    }
}